package hr_project.hr.biz.Dept;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import hr_project.hr.dao.emp.IDeptDao;
import hr_project.hr.entity.Department;
import hr_project.hr.util.pagebean;

@Service
public class DeptBizImpl implements IDeptBiz {

	@Autowired
	private IDeptDao dao;
	
	
	public IDeptDao getDao() {
		return dao;
	}

	public void setDao(IDeptDao dao) {
		this.dao = dao;
	}

	@Override
	public List<Department> getAll() {
		// TODO Auto-generated method stub
		return dao.getAll();
	}

	@Override
	public Department getByid(long id) {
		// TODO Auto-generated method stub
		return dao.getByid(id);
	}

	@Override
	public void addDept(Department dept) {
		// TODO Auto-generated method stub
        dao.addDept(dept);
	}

	@Override
	public void modDept(Department dept) {
		// TODO Auto-generated method stub
        dao.modDept(dept);
	}

	@Override
	public void delDept(long id) {
		// TODO Auto-generated method stub
       dao.delDept(id);
	}

	@Override
	public List<Department> getAllNotnormal() {
		// TODO Auto-generated method stub
		return dao.getAllNotnormal();
	}

	@Override
	public pagebean getAllBypage(int page) {
		// TODO Auto-generated method stub
		pagebean pb=new pagebean();
		pb.setCurrpage(page);
		pb.setPageSize(5);
		pb.setList(dao.getAllByPage(page, pb.getPageSize()));
		pb.setTotalRow(dao.getTotalRow());
		return pb;
	}

}
